$(function () {
    let id = localStorage.getItem("id");
    getbyid(id);
})
function getbyid(id) {
    $.get('/testPaper/getById',{id:id},function (data) {
        console.log(data);
        console.log(data.result)
        $("#grade").val(data.result.grade),
            $("#test_name").val(data.result.test_name),
            $("#subject").val(data.result.test_subject),
            $("#sum_title_num").val(data.result.sum_title_num)
        $("#sum_gader").val(data.result.sum_gader),
            $("#choose_gader").val(data.result.choose_gader),
            $("#completion_gader").val(data.result.completion_gader),
            $("#recognized_gader").val(data.result.recognized_gader)
        /*                    $("#completion_rander_num").val(data.result.completion_rander_num),
                            $("#completion_title2_sd").val(data.result.completion_title_sd),
                            $("#recongnized_rander_num").val(data.result.recongnized_rander_num),
                        $("#recongnized_title3_sd").val(data.result.recongnized_title_sd)
                    $("#choose_rander_num").val(data.result.choose_rander_num),
                        $("#choose_title_sd").val(data.result.choose_title_sd),
                        var sum = data.result.choose_number + data.result.completion_num + data.result.recognized_num;
                    $("#sum_title_num").attr("value").append(sum);*/
    },'json')
}
function update() {
    console.log($("#completion_num").val());
    console.log($("#recognized_num").val());
    console.log($("#recognized_gader").val());
    $.get('/testPaper/updateTestPaper',{
        test_name: $("#test_name").val(),
        grade: $("#grade").val(),
        test_subject: $("#test_subject").val(),
        sum_gader: $("#sum_gader").val(),
        sum_title_num: $("#sum_title_num").val(),
        choose_gader: $("#choose_gader").val(),
        /*            choose_rander_num: $("#choose_rander_num").val(),
                    choose_title_sd: $("#choose_title_sd").val(),*/
        completion_gader: $("#completion_gader").val(),
        recognized_gader: $("#recognized_gader").val(),
        paper_rollOfPeople:$("#paper_rollOfPeople").val(),
        id:localStorage.getItem("id")
        /*            recognized_rander_num: $("#recongnized_rander_num").val(),
                    recongnized_title_sd: $("#recongnized_title3_sd").val()*/
    },function (data) {
        console.log(data);
        alert(data.result);
    },'json');
}
$(document).ready(function () {
    var date = new Date();
    var year = date.getFullYear();
    console.log(year);
    let html = '<option>' + year + '</option>\n' +
        '            <option>' + (year - 1) + '</option>\n' +
        '            <option>' + (year - 2) + '</option>\n' +
        '            <option>' + (year - 3) + '</option>';
    $("#grade").html(html);
});